<extend name="Public/base"/>

<block name="header">
    <li><a href="javascript:">环境检测</a></li>
    <li class="active"><a href="javascript:">创建数据库</a></li>
    <li><a href="javascript:">安装</a></li>
    <li><a href="javascript:">完成</a></li>
</block>

<block name="body">
    <?php
        defined('SAE_MYSQL_HOST_M') or define('SAE_MYSQL_HOST_M', '127.0.0.1');
        defined('SAE_MYSQL_HOST_M') or define('SAE_MYSQL_PORT', '3306');
    ?>
    <form action="__SELF__" method="post" target="_self" class="form-horizontal">
        <div class="panel panel-primary">
            <div class="panel-heading">数据库连接信息</div>
            <div class="panel-body">

                <div class="form-group">
                    <label class="col-sm-2 control-label">数据库连接类型</label>

                    <div class="col-sm-6">

                        <select name="db[]" class="form-control">
                            <option>mysqli</option>
                            <option>mysql</option>
                        </select>
                    </div>
                    <div class="col-sm-4">
                        <small>服务器支持的情况下建议使用mysqli</small>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">数据库服务器IP</label>

                    <div class="col-sm-6">

                        <input type="text" name="db[]" class="form-control"
                               value="<defined name='SAE_MYSQL_HOST_M'>{$Think.const.SAE_MYSQL_HOST_M}<else/>127.0.0.1</defined>">
                    </div>
                    <div class="col-sm-4">
                        <small>一般为127.0.0.1</small>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">数据库名</label>

                    <div class="col-sm-6">

                        <input type="text" class="form-control" name="db[]"
                               value="<defined name='SAE_MYSQL_DB'>{$Think.const.SAE_MYSQL_DB}</defined>">

                    </div>
                    <div class="col-sm-4">
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-2 control-label">数据库用户名</label>

                    <div class="col-sm-6">

                        <input type="text" name="db[]" class="form-control"
                               value="<defined name='SAE_MYSQL_USER'>{$Think.const.SAE_MYSQL_USER}</defined>">
                    </div>
                    <div class="col-sm-4">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">数据库密码</label>

                    <div class="col-sm-6">

                        <input type="password" name="db[]" class="form-control"
                               value="<defined name='SAE_MYSQL_PASS'>{$Think.const.SAE_MYSQL_PASS}</defined>">
                    </div>
                    <div class="col-sm-4">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">数据库端口</label>

                    <div class="col-sm-6">

                        <input type="text" name="db[]" class="form-control"
                               value="<defined name='SAE_MYSQL_PORT'>{$Think.const.SAE_MYSQL_PORT}<else/>3306</defined>">
                    </div>
                    <div class="col-sm-4">
                        <small>一般为3306</small>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">数据表前缀</label>

                    <div class="col-sm-6">

                        <input type="text" name="db[]" value="ymt_" class="form-control">
                    </div>
                    <div class="col-sm-4">

                    </div>
                </div>
            </div>
        </div>
        <div class="panel panel-primary">
            <div class="panel-heading">超级管理员信息</div>
            <div class="panel-body">

                <div class="form-group">
                    <label class="col-sm-2 control-label">用户名</label>

                    <div class="col-sm-6">

                        <input type="text" name="admin[]" value="admin" class="form-control">
                    </div>
                    <div class="col-sm-4">

                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">密码</label>

                    <div class="col-sm-6">
                        <input type="password" name="admin[]" value="" class="form-control">
                    </div>
                    <div class="col-sm-4">

                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">确认密码</label>

                    <div class="col-sm-6">
                        <input type="password" name="admin[]" value="" class="form-control">
                    </div>
                    <div class="col-sm-4">

                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">邮箱</label>

                    <div class="col-sm-6">
                        <input type="text" name="admin[]" value="" class="form-control">
                    </div>
                    <div class="col-sm-4">
                        <small>请填写正确的邮箱便于收取提醒邮件</small>
                    </div>
                </div>
            </div>
        </div>
    </form>
</block>

<block name="footer">
    <a class="btn btn-success btn-large" href="{:U('Install/step1')}">上一步</a>
    <button id="submit" type="button" class="btn btn-primary btn-large" onclick="$('form').submit();return false;">下一步
    </button>
</block>
